package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 综合统计表
 * @TableName statistics
 */
@TableName(value ="statistics")
@Data
public class Statistics {
    /**
     * 统计ID
     */
    @TableId(type = IdType.AUTO)
    private Long statId;

    /**
     * 统计类型
     */
    private Object statType;

    /**
     * 统计范围
     */
    private Object statRange;

    /**
     * 统计日期
     */
    private Date statDate;

    /**
     * 指标1（教室：申请数量/考试：场次）
     */
    private Integer metric1;

    /**
     * 指标2（教室：使用率/考试：监考人次）
     */
    private Integer metric2;

    /**
     * 指标3（教室：超额数/考试：及格率）
     */
    private BigDecimal metric3;

    /**
     * 指标4（教材：库存量/课程：开课数）
     */
    private Integer metric4;

    /**
     * 指标5（教材：总价值/课程：平均学分）
     */
    private BigDecimal metric5;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Statistics other = (Statistics) that;
        return (this.getStatId() == null ? other.getStatId() == null : this.getStatId().equals(other.getStatId()))
            && (this.getStatType() == null ? other.getStatType() == null : this.getStatType().equals(other.getStatType()))
            && (this.getStatRange() == null ? other.getStatRange() == null : this.getStatRange().equals(other.getStatRange()))
            && (this.getStatDate() == null ? other.getStatDate() == null : this.getStatDate().equals(other.getStatDate()))
            && (this.getMetric1() == null ? other.getMetric1() == null : this.getMetric1().equals(other.getMetric1()))
            && (this.getMetric2() == null ? other.getMetric2() == null : this.getMetric2().equals(other.getMetric2()))
            && (this.getMetric3() == null ? other.getMetric3() == null : this.getMetric3().equals(other.getMetric3()))
            && (this.getMetric4() == null ? other.getMetric4() == null : this.getMetric4().equals(other.getMetric4()))
            && (this.getMetric5() == null ? other.getMetric5() == null : this.getMetric5().equals(other.getMetric5()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStatId() == null) ? 0 : getStatId().hashCode());
        result = prime * result + ((getStatType() == null) ? 0 : getStatType().hashCode());
        result = prime * result + ((getStatRange() == null) ? 0 : getStatRange().hashCode());
        result = prime * result + ((getStatDate() == null) ? 0 : getStatDate().hashCode());
        result = prime * result + ((getMetric1() == null) ? 0 : getMetric1().hashCode());
        result = prime * result + ((getMetric2() == null) ? 0 : getMetric2().hashCode());
        result = prime * result + ((getMetric3() == null) ? 0 : getMetric3().hashCode());
        result = prime * result + ((getMetric4() == null) ? 0 : getMetric4().hashCode());
        result = prime * result + ((getMetric5() == null) ? 0 : getMetric5().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", statId=").append(statId);
        sb.append(", statType=").append(statType);
        sb.append(", statRange=").append(statRange);
        sb.append(", statDate=").append(statDate);
        sb.append(", metric1=").append(metric1);
        sb.append(", metric2=").append(metric2);
        sb.append(", metric3=").append(metric3);
        sb.append(", metric4=").append(metric4);
        sb.append(", metric5=").append(metric5);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}